package me.softwareengineer.guice.rendering.domain;

import java.util.List;

import me.softwareengineer.guice.rendering.listener.EndQuotationLineEvent;
import me.softwareengineer.guice.rendering.listener.Listener;
import me.softwareengineer.guice.rendering.listener.StartQuotationLineEvent;

/**
 * Represents a line in {@link QuotationElement}. Several quotation lines can
 * exist in {@link QuotationElement}
 * 
 * @author yadtahir
 * @see QuotationElement <pre>
 * This class is thread-safe and can be cached/re-used and used concurrently.
 * </pre>
 */
public class QuotationLineElement extends Element {

	/**
	 * Creates a quotation line without properties
	 * 
	 * @param children
	 *            the children elements. Check {@link HasChildren}
	 */
	public QuotationLineElement(List<Element> children) {
		super(children);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void afterElement(Listener listener) {
		EndQuotationLineEvent e = new EndQuotationLineEvent();
		listener.onEvent(e);
	}

	/**
	 * {@inheritDoc}
	 */
	@Override
	public void beforeElement(Listener listener) {
		StartQuotationLineEvent e = new StartQuotationLineEvent();
		listener.onEvent(e);
	}

}
